#pragma once 
#include "wx/wx.h"
#include "GraphicImageModel.h"
#include "GraphicImagePresenter.h"
#include "GraphicImageZoomController.h"
#include "Image.h"
//#include "MainFrame.h"
class MainFrame;
class ImageCanvas: public wxWindow
{
public:
	ImageCanvas( MainFrame *parent, int w, int h);
	~ImageCanvas()
	{
		if(model)
			delete model;
		if(presenter)
			delete presenter;
	}

protected:
	void OnLbuttonUp(wxMouseEvent &event);
	void OnLbuttonDown(wxMouseEvent &event);
	void OnMouseMove(wxMouseEvent &event);
	void OnRbuttonDown(wxMouseEvent &event);
    void OnPaint(wxPaintEvent &paintevent);
	void OnSize(wxSizeEvent& sizeevent);
	//void SetImage(NOVA::Image* img){m_pImage = img;}
public:
	NOVA::GraphicImagePresenter *GetPresenter()
	{return presenter;}

   // void OnMouseMove(wxMouseEvent &event);

   // void ToShow(ScreenToShow show) { m_show = show; Refresh(); }

    // set or remove the clipping region
    //void Clip(bool clip) { m_clip = clip; Refresh(); }


private:
    MainFrame *m_owner;
	int flag;
    //ScreenToShow m_show;
   // wxBitmap     m_smile_bmp;
    wxIcon       m_std_icon;
    bool         m_clip;
	//NOVA::Image* m_pImage;
	NOVA::GraphicImagePresenter *presenter;
	GraphicImageModel * model;
	std::auto_ptr<NOVA::GraphicImageZoomController> m_zoom;


    DECLARE_EVENT_TABLE()
};